﻿namespace TextFiles
{
    using System;
    using System.IO;

    class ConcatenatingTwoFilesInThird
    {
        // 1.2.12.02. Write a program that concatenates two text files into another text file.

        static void Main()
        {
            StreamReader sr1 = new StreamReader(@"../../App.config");
            string final = null;
            using (sr1)
            {
                string first = sr1.ReadToEnd();
                sr1 = new StreamReader(@"../../ConcatenatingTwoFilesInThird.cs");
                final = first + sr1.ReadToEnd();
            }

            StreamWriter sw = new StreamWriter(@"../../final.txt");
            using (sw)
            {
                sw.Write(final);
            }
        }
    }
}